Templatized Primitive Method Idiom
نویسنده
چکیده
Template Method Pattern (see [5]) solves the problem of the existence of a generic algorithm for a family of classes that needs specialization in each and every concrete class. It does so by implementing the algorithm in the base class and by forwarding implementation details to (pure) virtual functions. In terms of [5] these forwarding functions are called primitive. In this paper we propose an implementation of the Template Method Pattern in C++ that addresses the question of stronger insulation of primitive functions, in the sense of [7], and of better conformance to the Open Closed Principle of Bertrand Meyers (see [9]). Mixing virtual functions and templates the Templatized Primitive Method Idiom gives an example of mixing subtype and parametric polymorphism in what we believe is an interesting and powerful idiom.
منابع مشابه
The Comparative Effect of Using Idioms in Conversation and Paragraph Writing on EFL Learners’ Idiom Learning
This study investigated the comparative effect of teaching idiomatic expressions through practicing them in conversation and paragraph writing on intermediate EFL learners’ idiom learning. The participants were sorted out of a population of 134 intermediate students in Zabansara Language School in Khorramabad based on their scores on a Preliminary English Test (PET) and an idiom test piloted in...
متن کاملConstruction of an Idiom Corpus and its Application to Idiom Identification based on WSD Incorporating Idiom-Specific Features
Some phrases can be interpreted either idiomatically (figuratively) or literally in context, and the precise identification of idioms is indispensable for full-fledged natural language processing (NLP). To this end, we have constructed an idiom corpus for Japanese. This paper reports on the corpus and the results of an idiom identification experiment using the corpus. The corpus targets 146 amb...
متن کاملThe Performance of Iranian EFL Learners in Producing and Recognizing Idiom-Containing Sentences
This study aimed to investigate how Iranian EFL learners performed in producing sentences containing idioms and whether they had any problems in producing such sentences. This query, subsequently, raised the question of whether idioms influenced the participants’ grammaticality judgment on idiom-containing sentences. For this purpose, firstly, the writings of 24 learners were investigated for a...
متن کاملDrawing a Line between Literal and Idiomatic Meanings Based on Supervised WSD
Hashimoto, Chikara and Kawahara, Daisuke. 2008. Drawing a Line between Literal and Idiomatic Meanings Based on Supervised WSD. Linguistic Research 25(2), 105-123. Some phrases can be interpreted either idiomatically (figuratively) or literally in context, and the precise identification of idioms is indispensable for full-fledged natural language processing (NLP). To this end, we have constructe...
متن کاملTowards Maintenance Support for Idiom-based Code Using Sequential Pattern Mining
Developers often use an idiom to implement a concern. When a fault is found in an idiom, developers have to find all source code fragments derived from the original. While code-clone detection tools can detect copy-andpasted code, such tools cannot detect code fragments modified after pasted. We are investigating a sequential pattern mining approach to capture idiom-based code that spread acros...
متن کامل